<template>
<div>
  <my-book></my-book>
  <button type="button" @click="gotoNext">goto page2</button>
</div>
</template>

<script setup>
import MyBook from '@/components/props/MyBook'

// 在 setup 中访问路由和当前路由
// https://next.router.vuejs.org/zh/guide/advanced/composition-api.html#%E5%9C%A8-setup-%E4%B8%AD%E8%AE%BF%E9%97%AE%E8%B7%AF%E7%94%B1%E5%92%8C%E5%BD%93%E5%89%8D%E8%B7%AF%E7%94%B1
import { useRouter, useRoute } from "vue-router"

const router = useRouter()
const route = useRoute()
console.log('route=', route)
console.log('route path=', route.path)

const gotoNext = () => {
  console.log('进入下一页')
  router.push('/routerback')
}
</script>